#pragma once
#include "../vfs/FileDeviceHandle.h"

namespace ja2{ namespace vfs
{
	//! Regular file.
	class FileDeviceHandleRegular : public FileDeviceHandle
	{
		// Attributes
	private:
		//! File stream from which to read/write.
		std::ifstream m_Stream;

		// Operations
	private:
		//! See base.
		virtual std::streamsize read(char *Buffer, std::streamsize Size);
		//! See base.
		virtual std::streamsize write(const char* Buffer, std::streamsize Size);
		//! See base.
		virtual boost::iostreams::stream_offset seek(boost::iostreams::stream_offset Offset, std::ios_base::seekdir Direction);
		//! See base.
		virtual void open(std::ios_base::openmode mode);
		//! See base.
		virtual bool is_open() const;
		//! See base.
		virtual void close();

		// Construction/Destruction
	public:
		FileDeviceHandleRegular(boost::filesystem::path const &FilePath);
		FileDeviceHandleRegular(boost::filesystem::path const &FilePath, std::ios_base::openmode Mode);
	};
} /*vfs*/} /*ja2*/
